package com.dddd.blog.api.user.feign;

import com.dddd.blog.blogcommon.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author 喵星球的大橘
 */
@FeignClient(value = "blogSpiderService",path = "/spider",qualifier = "blogSpiderService")
public interface SpiderFeignClient {


    /**
     * 远程调用Spider服务的接口，获取用户(名)列表
     * @return
     */
    @GetMapping("/loadNames")
    Result<List<String>> loadAuthor();

    /**
     * 远程调用Spider服务的接口，获取用户列表
     * @return
     */
    @GetMapping("/loadAuthors")
    Result<List<Map<String,Object>>> loadAuthorList();


    /**
     * 远程调用Spider服务的接口，分页获取用户列表
     * @param currentPage 页码
     * @param pageSize 条数
     * @return
     */
    @PostMapping("/loadAuthor/page")
    Result<List<Map<String,Object>>> loadAuthorListPage(@RequestParam("currentPage") long currentPage,
                                                        @RequestParam("pageSize") long pageSize);

}
